<script setup lang="ts">
import { storeToRefs } from 'pinia'
import { useHospitalStore } from '@/store/modules/hospital'

const useHospital = useHospitalStore()
const { registerData } = storeToRefs(useHospital)
</script>
<template>
  <div class="hospital-detail">
    <!-- title : 北京人民医院 icon 三级甲等-->
    <div class="titlebox">
      <custom-title-v2
        class="name"
        :title="registerData?.hospital?.hosname"
      ></custom-title-v2>
      <hospital-level
        :levelName="registerData.hospital?.param.hostypeString"
      ></hospital-level>
    </div>
    <div class="introbox">
      <div class="logo">
        <img
          class="logo-img"
          :src="`data:image/jpeg;base64,${registerData.hospital?.logoData}`"
          alt=""
        />
        <!-- <img class="logo-img" src="../../../assets/images/logo.png" alt="" /> -->
      </div>
      <div class="intro-info">
        <div class="location">
          <span class="title"> <icon-location></icon-location>具体位置:</span>
          <span class="content">
            {{ registerData.hospital?.param.fullAddress }}
          </span>
        </div>
        <div class="location">
          <span class="title">路线:</span>
          <span class="content">
            {{ registerData.hospital?.route }}
          </span>
        </div>
      </div>
    </div>
    <!-- 医院介绍 -->
    <div class="hosinfo">
      <custom-title-v1 title="医院介绍"></custom-title-v1>
      <div class="infodesc">{{ registerData.hospital?.intro }}</div>
    </div>
  </div>
</template>
<style scoped lang="less">
.hospital-detail {
  padding: 20px;
  .titlebox {
    display: flex;
    align-items: center;
    .name {
      margin-right: 20px;
    }
  }
  .introbox {
    display: flex;
    padding: 20px 0;

    .logo {
      width: 150px;
      text-align: center;
      padding: 15px 0;
      .logo-img {
        width: 100px;
        height: 100px;
      }
    }
    .intro-info {
      flex: 1;
      padding: 15px 0;
      .location {
        margin-bottom: 15px;

        .title {
          margin-right: 10px;
          letter-spacing: 2px;
          color: #999;

          .icon {
            width: 15px;
            height: 15px;
            margin: 0 10px;
          }
        }
        .content {
          line-height: 25px;
          text-align: justify;
          color: #666;
        }
      }
    }
  }
  .hosinfo {
    .infodesc {
      text-indent: 2em;
      color: #666;
      line-height: 28px;
      text-align: justify;
      letter-spacing: 0.1em;
    }
  }
}
</style>
